<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Block</title>

</head>

<body>
<?php
include("../connection/connection.php");
include("reportFunctions.php");
$distId=$_REQUEST['distId'];
$sqlReport = "SELECT `district_id`,`district_name`,`block_id`,`block_name`,count(distinct village_id)as NumVill,count(distinct `census_village_code`) as NumCenVill FROM `tbl_lookup_location` where `district_id` = ".$distId." group by `block_id`";
$queryReport = mysql_query($sqlReport);

?>
<table border="0" width="800" cellspacing="0" cellpadding="0">
	<tr>
		<td bgcolor="#E9E9E9" height="26">
		<p align="center">
		<font face="Verdana" style="font-size: 9pt; font-weight: 700" color="#224568">
		Block wise number of villages and villages served by different type of 
		water supply schemes (As per PHED)</font></td>
	</tr>
	<tr>
	  <td bgcolor="#E9E9E9" height="26"><div align="center"><font face="Verdana" style="font-size: 9pt; font-weight: 700" color="#224568">Table 1</font> </div></td>
  </tr>
	<tr>
		<td bgcolor="#E9E9E9" height="56">
		<table border="1" width="800" cellspacing="0" cellpadding="0" height="49" bgcolor="#C5D8EB">
			<tr>
				<td width="119" rowspan="2" align="center">
				<p align="center"><font face="Verdana" style="font-size: 8.5pt">
				Block</font></td>
				<td width="129" rowspan="2" align="center">
				<font face="Verdana" style="font-size: 8.5pt">Total No. of 
				Villages as per 2001 Census</font></td>
				<td width="131" rowspan="2" align="center">
				<p align="center"><font face="Verdana" style="font-size: 8.5pt">
				Data from Q1 &amp; Q2</font></td>
				<td colspan="4" align="center">
				<p align="center"><font face="Verdana" style="font-size: 8.5pt">
				Villages Served by different types of Water Supply Schemes</font></td>
			</tr>
			<tr>
				<td align="center" width="118">
				<font style="font-size: 8.5pt" face="Verdana">Piped</font></td>
				<td align="center" width="114">
				<font style="font-size: 8.5pt" face="Verdana">P &amp; T</font></td>
				<td align="center" width="104">
				<font style="font-size: 8.5pt" face="Verdana">RWSS</font></td>
				<td align="center" width="85">
				<font style="font-size: 8.5pt" face="Verdana">HP</font></td>
			</tr>
		</table>		</td>
	</tr>
	<tr>
		<td>
		<table border="1" width="800" cellspacing="0" cellpadding="0" height="49" bordercolor="#C5D8EB" style="border: 1px solid #BBD1E8" bgcolor="#F9F9F9">
			<?php
			$numVillage=0;
			$numFormVill=0;
			while($rowReport = mysql_fetch_array($queryReport)) {
			?><tr><td width='119' align='center'><font style="font-size: 8.5pt" face="Verdana"><?php echo $rowReport['block_name']; ?></font></td>
				<td width='124' align='center'><font style="font-size: 8.5pt" face="Verdana"><?php echo $rowReport['NumVill']; ?></td>
				<td width='127' align='center'><font style="font-size: 8.5pt" face="Verdana"><?php echo $numFormVillage=getNumVillBlockWise($distId,$rowReport['block_id']); ?></font></td>
				<td align='center' width='115'><font style="font-size: 8.5pt" face="Verdana"><?php echo getSchemeNoBlockWise($distId,'piped',$rowReport['block_id']); ?></font></td>
				<td align='center' width='112'><font style="font-size: 8.5pt" face="Verdana"><?php echo getSchemeNoBlockWise($distId,'P&T',$rowReport['block_id']); ?></font></td>
				<td align='center'><font style="font-size: 8.5pt" face="Verdana"><?php echo "0";//getSchemeNoBlockWise($distId,'piped',$rowReport['block_id']); ?></font></td>
				<td align='center' width='84'><font style="font-size: 8.5pt" face="Verdana"><?php echo getSchemeNoBlockWise($distId,'HP',$rowReport['block_id']); ?></font></td>
			</tr>
			<?php
			$numVillage+=$rowReport['NumVill'];
			$numFormVill+=$numFormVillage;
			}
			?>
			<tr><td width='119' align='center'><font style="font-size: 8.5pt" face="Verdana">Total</font></td>
			<td width='124' align='center'><font style="font-size: 8.5pt" face="Verdana"><?php echo $numVillage; ?></font></td>
				<td width='127' align='center'><font style="font-size: 8.5pt" face="Verdana"><?php echo $numFormVill; ?></font></td>
				<td align='center' width='115'><font style="font-size: 8.5pt" face="Verdana"><?php echo getSchemeNoDistWise($distId,'piped'); ?></font></td>
				<td align='center' width='112'><font style="font-size: 8.5pt" face="Verdana"><?php echo getSchemeNoDistWise($distId,'P&T'); ?></font></td>
				<td align='center'><font style="font-size: 8.5pt" face="Verdana"><?php echo "0";//getSchemeNoBlockWise($distId,'piped',$rowReport['block_id']); ?></font></td>
				<td align='center' width='84'><font style="font-size: 8.5pt" face="Verdana"><?php echo getSchemeNoDistWise($distId,'HP'); ?></font></td>
			</tr>
		</table>		</td>
	</tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>

</body>

</html>